package com.jeeplus.test.jlnu.changeStuInfo.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.test.jlnu.admissionInfo.domain.entity.AdmissionInfo;
import com.jeeplus.test.jlnu.archivalInfo.domain.vo.ArchivalInfoReqVo;
import com.jeeplus.test.jlnu.changeStuInfo.domain.entity.ChangeStuInfo;
import com.jeeplus.test.jlnu.changeStuInfo.domain.entity.ChangeStuInfoHistory;
import com.jeeplus.test.jlnu.changeStuInfo.domain.vo.ChangeStuInfoReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ChangeStuInfoDetailMapper {
    Page<ChangeStuInfo> selectPage(@Param("changeStuInfoReqVo") ChangeStuInfoReq changeStuInfo, String officeId, Page<ChangeStuInfo> page);

    @Select("SELECT type FROM sys_office WHERE id = #{id}")
    String getTypeById(String id);
    @Select("SELECT id, info_id, field, field_name, data_history, data_change " +
            "FROM jlnu_student_change_info_history " +
            "WHERE info_id = #{infoId} order by id desc")
    List<ChangeStuInfoHistory> getByInfoId(@Param("infoId") Long infoId);

    int batchUpdateChangeInfo(@Param("ids") List<String> ids, @Param("transferState") String transferState);

    int batchUpdateById(@Param("ids") List<String> ids,@Param("changeStuInfo") ChangeStuInfo changeStuInfo);


    int batchUpdateChange(@Param("admissionInfos") List<AdmissionInfo> admissionInfos,@Param("transferState") String transferState);

}
